package gatperdut.chato.core.room;

import gatperdut.chato.core.ChatoServer;
import gatperdut.chato.core.util.LockController;
import gatperdut.chato.model.Chato.Room.Door;

public class DoorController {

    private final ChatoServer chatoServer;

    private final Door door;

    private final LockController lockController;

    public DoorController( ChatoServer chatoServer, Door door ) {
        this.chatoServer = chatoServer;
        this.door = door;
        if ( getDoor().getLock() != null ) {
            lockController = new LockController( getDoor().getLock() );
        }
        else {
            lockController = null;
        }
    }

    public Door getDoor() {
        return door;
    }

    public boolean isLockable() {
        return lockController != null;
    }

    public ChatoServer getChatoServer() {
        return chatoServer;
    }

    public LockController getLockController() {
        return lockController;
    }

}
